﻿<Application 
	x:Class="Puzzle.App"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

	<!--Application Resources-->
	<Application.Resources>
		<!-- Grid -->
        <Style x:Key="GridLayoutRoot" TargetType="Grid">
            <Setter Property="Background">
                <Setter.Value>
                    <ImageBrush Stretch="Fill" ImageSource="Background.png" />
                </Setter.Value>
            </Setter>            
        </Style>
		<!-- Botoes do Menu  -->
		<Style x:Key="BtnMenuStylle" TargetType="Button">   
            <Setter Property="Margin" Value="20"/>
			<Setter Property="BorderBrush" Value="Black"/>
			<Setter Property="Foreground" Value="Black"/>
			<Setter Property="BorderThickness" Value="3"/>
			<Setter Property="FontFamily" Value="Eras Demi ITC"/>
			<Setter Property="FontSize" Value="48"/>
			<Setter Property="FontWeight" Value="Bold"/>
			<Setter Property="Padding" Value="10,3,10,5"/>
			<Setter Property="Background">
				<Setter.Value>    				    		
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FF494949" Offset="0"/>
						<GradientStop Color="#FFCDCDCD" Offset="1"/>
					</LinearGradientBrush>						
			</Setter.Value>
			</Setter>
			<Setter Property="Template">    		
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
									<VisualState x:Name="Pressed">
										<Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Black">
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="White"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
									</VisualState>    								
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" >
								<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		
	</Application.Resources>

	<Application.ApplicationLifetimeObjects>
		<!--Required object that handles lifetime events for the application-->
		<shell:PhoneApplicationService 
			Launching="Application_Launching" Closing="Application_Closing" 
			Activated="Application_Activated" Deactivated="Application_Deactivated"/>
	</Application.ApplicationLifetimeObjects>

</Application>
